package com.wedo.mall.activity;


import android.os.Bundle;
import android.os.Handler;


import com.e.library.activity.EActivity;
import com.e.library.utils.ESPUtils;
import com.wedo.mall.R;
import com.wedo.mall.activity.login.WLogin;



/**
 * Android 7.0多语言适配
 * http://www.jb51.net/article/113885.htm
 * Created by lxy on 2016/11/23.
 */

public class SplashActivity extends EActivity {

    @Override
    protected int layout() {
        return R.layout.activity_splash;
    }

    @Override
    protected void onActivityCreated(Bundle bundle) {

        isCorE();

        WLogin.tryLogin(this);
        disableSwipeBack();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                toTarget();
            }
        },3000);

    }

    private void toTarget(){
        if(!ESPUtils.getBoolean(this,"to_guide",true)){
            toActivity(MainActivity.class);
            defaultFinish();
        }else {
            toActivity(GuideActivity.class);
            defaultFinish();
        }
    }


}
